<?php
/**
 * Created by PhpStorm.
 * User: u
 * Date: 2019/4/29
 * Time: 22:48
 */

namespace common\sources\write\buspepperrecord;

use Yii;

class BusPepperRecordAccess
{
    public function addBusPepperRecord($param)
    {
        return Yii::$app->db->createCommand()->insert('business_pepper_record', [
            'bus_id' =>  $param['bus_id'],
            'task_commod_id' => isset($param['task_commod_id']) ? $param['task_commod_id']: '',
            'task_order_num' => isset($param['task_order_num'])? $param['task_order_num'] : '' ,
            'task_order_id' => isset($param['task_order_id']) ? $param['task_order_id'] : 0,
            'task_id' => isset($param['task_id']) ? $param['task_id'] : '',
            'type' => $param['type'],
            'expend' => $param['expend'],
            'income' => $param['income'],
            'balance' => $param['balance'],
            "freeze_change" => isset($param['freeze_change']) ? $param['freeze_change'] : 0,
            "freeze_balance" => isset($param['freeze_balance']) ? $param['freeze_balance'] : 0,
            'operatorId' => isset($param['operatorId']) ? $param['operatorId'] : 0 ,
            'remark' => $param['remark'],
            'create_time' => time()
        ])->execute();
    }
}